<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <base href="<?php echo (C("BASE")); ?>">
    <link rel="stylesheet" type="text/css" href="ui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="css/icon.css">  
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <script type="text/javascript" src="ui/jquery.min.js"></script>     
    <script type="text/javascript" src="ui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="ui/locale/easyui-lang-zh_CN.js"></script> 
    <script src="layer/layer.js"></script>   
    <title>后台管理</title>     
</head>
<body>


<h2><?php echo ($title); ?></h2>
<table id='tab' class="easyui-datagrid" data-options="url:'/thinkphp/index.php/Admin/stock/index/id/8',fitColumns:true,singleSelect:true,toolbar:'#tool'">   
    <thead>   
        <tr>   
            <th data-options="field:'id',width:'100'">ID</th>               
            <th data-options="field:'pid',width:'100'">产品</th> 
            <th data-options="field:'tag',width:'100'">产品属性值</th> 
            <th data-options="field:'num',width:'100'">数量</th>   
            <th data-options="field:'money',width:'100'">价格</th>        
            <th data-options="field:'ctime',width:'100'">添加时间</th>
            <th data-options="field:'utime',width:'100'">修改时间</th>   
           
        </tr>   
    </thead>   
    
</table>  
<div id='tool'>
<a href="<?php echo U('add');?>" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a>
<a id='editbtn' href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a>
<a id='delbtn'  href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">删除</a>

</div>
<form method="post" action="/thinkphp/index.php/Admin/Stock/add/id/<?php echo ($_GET['id']); ?>">
<?php if(is_array($attr)): foreach($attr as $key=>$v): ?><div>
	<label><?php echo ($v["title"]); ?></label>
		<?php if(($v["isselect"]) == "0"): ?><input type="text" name="title" style="width:150px;" class="easyui-textbox"/>
		<?php else: ?>
			<select class="easyui-combobox" name="<?php echo ($v["id"]); ?>" style="width:150px;">
				<?php if(is_array($v["options"])): foreach($v["options"] as $key=>$v1): ?><option value="<?php echo ($v1); ?>"><?php echo ($v1); ?></option><?php endforeach; endif; ?>
			</select><?php endif; ?>
</div><?php endforeach; endif; ?>
<div>
	<label>数量</label>
	<input type="text" name="num" class="easyui-numberbox"  data-options="min:0,precision:0" style="width:150px;"/>
</div>
<div>
	<label>价格</label>
	<input type="text" name="money" class="easyui-numberbox"  data-options="min:0,precision:2" style="width:150px;"/>元
</div>

<input type="submit" value="提交" class="easyui-linkbutton" data-options="width:'70'"/>
</form>
<script>

</script>

</body>
</html>